{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ignore this\n",
    "%load_ext music21.ipython21"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# User's Guide: Chapter 18: Intervals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "sphinx_links": {
     "any": true
    }
   },
   "source": [
    "Intervals, or distances in pitch space between two pitches, are fundamental concepts of music theory, dating back at least to Ancient Greece, and are thus fundamental concepts in `music21` as well.\n",
    "\n",
    "Different forms of music theory analysis, such as tonal theory, modal theory, and chromatic (atonal) theory use different kinds of intervals. Thus `music21` has a collection of interval classes that can be used in different situations.  They are all found in the :ref:`interval <moduleInterval>` module, which also contains some handy tools for creating and comparing intervals.  This chapter of the User's Guide explains how to create and use Interval objects."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The `Interval` Class"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We're going to break from the tradition of starting with the simplest objects and begin with the most flexible but also complex object, simply called :class:`~music21.interval.Interval`, since if you're going to learn about even a single Interval, it might as well be the most useful one.\n",
    "\n",
    "We can create an `Interval` object by giving an abbreviation for the interval as a string.  For instance, if we want to model a perfect fifth, we'll use the string `\"P5\"`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval P5>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i = interval.Interval('P5')\n",
    "i"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can see some properties of Interval objects:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Perfect Fifth'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.niceName"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'P5'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.semitones"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.isStep"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's a rule that assumes a musical context from the late fourteenth century to the end of the nineteenth century:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.isConsonant()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What do we need to make this interval add up to an octave?  That's the complement:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval P4>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.complement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `.intervalClass` of an Interval of the number of semitones of the smaller of the interval or its complement:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.intervalClass"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A cent is 1/100th of a semitone:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "700.0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.cents"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can get a descending form of the Interval with the `.reverse()` method:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval P-5>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.reverse()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's suppose that the interval is the distance between B4 and some other note, what note would that be?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.note.Note F#>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.noteStart = note.Note('B4')\n",
    "i.noteEnd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or we can use this interval to transpose any given Note:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.note.Note G>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.transposeNote(note.Note('C5'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or we can use intervals to transpose pitches:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.pitch.Pitch G5>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i.transposePitch(pitch.Pitch('C5'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that Pitch, Note, Chord, and Stream objects all have a `.transpose()` method.  These methods take `Interval` objects as arguments (or, if given something else such as a string, the methods try to automatically create an Interval):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.pitch.Pitch B3>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pitch.Pitch('E3').transpose(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.chord.Chord C E G>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chord.Chord(\"F A C\").transpose(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAisAAABiCAYAAACRZpOlAAAACXBIWXMAAB7CAAAewgFu0HU+AAAWFklEQVR4nO3deZQc1XXH8e9IgxbQvoJAIBCIRUaA2BcLECACCIUlxNiAMRjbhCVAHMchJ2ACBIcDBAiBYAOGYGM7iQFZNjHGliEsEostIAGEQUYSlgEhtCChZaSRJn/cKndNTVV1VVdVV3fX73NOn+6prum+0kz3vH7v3Xuh/qYCy4C1wF4FPL+IiIhIqHOBTUCXc3kd6F9oRCIiIiKOM4HNVAYq7uWGIoMSERERATgQ6KDnQKXLOb5HcaGJiIhI2Q0G3iF4oOJeHi0sOhERESm9W4keqHQBW4B9iwpQREREyms3YCPVBytdwH8WFKOIiIiU2P1UH6SsdK43AWOKCVNERETKaAzhm2q7sBmXm4EhwPvOsWuKCFRERETK6auED1T+ABzmOfd7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rIDlr7H/h7LPTMedzZcmk2YUPgn4cozzzsb6B70dcY53U209y+qLiBShL1anaWDEddR93mvvAKU3NrtQVg2T4irZSjNYmYHVRammDWsKGDVYGeu5/WGKmERE8tCGDTDiDCDinFP2GRCRRNIMVpIU3RlV5X632/JKrOCaiEha7gAji8GFBhgiBUozWFmV4NylVe53mxfOrzEWESkn90PTicBz9ByAlG3DaVmr10qLS/NCfi/meZ3A4xH398F6OQA8liIeESkftwfMWLovJ5eVBivSktLUWXk65nk30bOPjtfnqfT3mJkiHhEREZEeFhKesrwFuI3oAdEAz2NooCIiSZ1D9fIJrXrpxPb5vQu8BszFsoFEWk7a9dwbgG87tzdgBeK2wV48PwJeqfL9twDjgM2Uu727iNRmQdEBJLQZSyJYXeU6zjnrsUGLSMtLO1j5DnAhMBkrxrMdcBrx1k2/TqVOy1XAqyljEZHyqUdNkc1UHzjEHWRsQAMMkcTi1EmpZkfgJSrpyU8BZxG+AXcAcCNwkfP1LOAU9AIWkeQOwN5//DrJbgZDAwyRFjEJ20TrrqWuxZaETsfeTPYBTgJuBT7wnPcwlg0kIlKLwcAUYD+sXtMobJY3iw9iItKCRgOPEG9j2FrgSrQZTERERApwCHAvtgzkH6TMB67Flo5EREREqvp/iF13vd3eIjgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 277
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = converter.parse('tinyNotation: 4/4 c4 d e8 f# g4')\n",
    "s2 = s.transpose(i)\n",
    "s2.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All intervals have properties called \"simpleName\" and \"semiSimpleName\" that become useful for reducing compound intervals (those over an octave) to smaller forms. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'P5'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i2 = interval.Interval('P-12')\n",
    "i2.simpleName"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'P-5'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i2.directedSimpleName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For most intervals, `simple` and `semiSimple` mean the same thing, but while `simple` will reduce an octave to a unison, `semiSimple` treats octaves as distinct intervals.  There are certain theories where we want to consider, say, parallel octaves and parallel unisons differently (or at least display a different message to the user), but where we don't care about the difference between a third and a tenth:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Perfect Unison', 'Minor Third')"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p8 = interval.Interval('P8')\n",
    "m10 = interval.Interval('m10')\n",
    "(p8.simpleNiceName, m10.simpleNiceName)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Perfect Octave', 'Minor Third')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(p8.semiSimpleNiceName, m10.semiSimpleNiceName)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that capitalization makes a difference in determining Major and minor:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Minor Third'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('m3').niceName"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Major Third'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('M3').niceName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Creating diminished and Augmented intervals is as simple as using \"d\" and \"A\" in the string:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Diminished Fifth'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('d5').niceName"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Augmented Fourth'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('A4').niceName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And, yes, multiple letters can get certain obscure intervals:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diminished Fifth\n",
      "Doubly-Diminished Fifth\n",
      "Triply-Diminished Fifth\n",
      "Augmented Fourth\n",
      "Doubly-Augmented Fourth\n",
      "Triply-Augmented Fourth\n"
     ]
    }
   ],
   "source": [
    "for intName in ['d5', 'dd5', 'ddd5', 'A4', 'AA4', 'AAA4']:\n",
    "    iTemp = interval.Interval(intName)\n",
    "    print(iTemp.niceName)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Up to a reasonable limit:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Quadruply-Diminished Fifth'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('dddd5').niceName"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.pitch.Pitch G----4>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval('dddd5').transposePitch(pitch.Pitch('C4'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Can't do five ds!\n"
     ]
    }
   ],
   "source": [
    "try:\n",
    "    interval.Interval('ddddd5').niceName\n",
    "except interval.IntervalException:\n",
    "    print(\"Can't do five ds!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Other ways of constructing Interval objects\n",
    "\n",
    "The method of creating an interval from a string such as \"A4\" or \"d5\" is great if you know the interval's name in advance.  But what if you don't?  Fortunately, there are some other great ways to create them.\n",
    "\n",
    "First, if you have two Note or Pitch objects, pass them into the `Interval` constructor as the first and second elements:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Perfect Fourth'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e = note.Note('E4')\n",
    "a = note.Note('A4')\n",
    "p4 = interval.Interval(e, a)\n",
    "p4.niceName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or, you can create intervals from an integer, representing the number of half-steps:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval P5>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.Interval(7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 Perfect Unison\n",
      "1 Minor Second\n",
      "2 Major Second\n",
      "3 Minor Third\n",
      "4 Major Third\n",
      "5 Perfect Fourth\n",
      "6 Diminished Fifth\n",
      "7 Perfect Fifth\n",
      "8 Minor Sixth\n",
      "9 Major Sixth\n",
      "10 Minor Seventh\n",
      "11 Major Seventh\n",
      "12 Perfect Octave\n",
      "13 Minor Ninth\n"
     ]
    }
   ],
   "source": [
    "for semitones in range(14):\n",
    "    tempInt = interval.Interval(semitones)\n",
    "    print(semitones, tempInt.niceName)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, music theory geeks will wonder, how does `music21` know that six semitones is a \"Diminished Fifth\" and not an Augmented Fourth?  (Or for that matter, that three semitones is a Minor Third and not an Augmented Second or Triply-Augmented Unison?)\n",
    "\n",
    "The answer is that it takes a good guess, but it records that the \"diatonic interval\" (that is \"Diminished Fifth,\" etc.) is just a guess, or is \"implicit\":"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(True, False)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sixSemis = interval.Interval(6)\n",
    "d5 = interval.Interval('d5')\n",
    "(sixSemis.implicitDiatonic, d5.implicitDiatonic)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This distinction makes a difference if we use these two interval objects to transpose a pitch.  Take the pitch \"G flat\".  A diminished fifth above it is \"D double flat\", but if most of us were inclined to think about \"a tritone above G flat\" we'd probably think of C.  The implicitDiatonic flag allows the six-semitone interval to make these sorts of intelligent decisions, while the interval that was explicitly specified to be a diminished fifth will do exactly what is asked (so long as it doesn't go to more than quadruple flat or sharp):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.pitch.Pitch C>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sixSemis.transposePitch(pitch.Pitch('G-'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.pitch.Pitch D-->"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d5.transposePitch(pitch.Pitch('G-'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can create new intervals by adding existing Intervals together:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval M7>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i1 = interval.Interval('P5')\n",
    "i2 = interval.Interval('M3')\n",
    "i3 = interval.add([i1, i2])\n",
    "i3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's a nice way of making sure that a major scale actually does repeat at an octave (and a demo that \"W\" and \"H\" are synonyms for whole and half steps; and that `interval.add()` can automatically convert strings to Intervals:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval P8>"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.add([\"W\", \"W\", \"H\", \"W\", \"W\", \"W\", \"H\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or one can create new intervals by subtracting old ones:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval m3>"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "interval.subtract([i1, i2])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Subtraction, of course, is not commutative:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Descending Minor Third'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iDown = interval.subtract([i2, i1])\n",
    "iDown.directedNiceName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Intervals are returned by several analysis routines in `music21`.  For instance, if you want to know the range from the lowest to the highest note in a piece:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABdgAAABkCAYAAACVf1KhAAAACXBIWXMAAB7CAAAewgFu0HU+AAAgAElEQVR4nO3dd7gkdZno8e+ZGWaYgckkB4EBZgiChJFoQAVREBZRFEyoa7rGC14Vl10xAHoNqHhVVkXMIMZF97q6IkaCYkIUhyRBkDzMDMMMTDz7x1tt1+lT1V0dq7vP9/M8/VR1pX7PqQ5Vb/3q/UHvHQ7cD6wGHlfC60uSJEmSJEmSNHBeDqwHRpPHdcD0UiOSJEmSJEmSJKnPvRDYSDW5Xnm8v8ygJEmSJEmSJEnqZwcCaxmfXB9Npu9RXmiSJEmSJEmSJPWn2cAtZCfXK4//KC06SZIkSZIkSZL61Meon1wfBTYB+5UVoCRJkiRJkiRJ/WYxsI7GCfZR4BslxShJkiRJkiRJUt/5Ao0T68uT4XpgQTlhSpIkSZIkSZLUPxaQ37HpKNGy/RxgDnB3Mu09ZQQqSZIkSZIkSVI/eSv5yfW/A09MLfvVZPqtPY5RkiRJkiRJkqS+cznZyfXrge1qlj0lNf/QHsYoSZIkSZIkSVJf2RzYwPjk+q1k11k/PLXMuT2KUZIkSeq1EWB/YLOyA5EkSZLUvw4gu+b6gTnL78rYFu6SJEnSMDqUOOZ9c9mBSJIkSWrfpC5td/eMaWcDv8lZ/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ntz7kCVJkiRJkiRJrdiH6Mi0kuRdTZSLOQE4gOis8xjgY8A9qeW+DUztfbh9735aT64/v4R4JUmSJEmSJElt2Bb4DsUSwauJsjCTS4m0/11E88n1FcBxZQQrSZIkSZIkSeqMQ4DPAXcxPgm8FDiTKCujfIuBhyieXL8CWFhGoJIkSZIkSZKk7pgN7AbsDEwrOZZBcyhwM/UT678Dnos17CVJkiRJkiSp50zM9rfJwNOAg4DtiKT6MuAW4JfA30qLTJIkSZIkSZImuP8Bz4sh1Jl8g68AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 50,
       "width": 748
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = converter.parse('4/4 c4 d e f# g# a# g f e1', format=\"tinyNotation\")\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval A6>"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.analyze('range')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a6 = s.analyze('range')\n",
    "a6.semitones"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Related Interval Classes\n",
    "\n",
    "There are three other `Interval` classes in the `interval` module that can be helpful in different cases.  Two of them you've already been using without knowing it, they are the :class:`~music21.interval.DiatonicInterval` and :class:`~music21.interval.ChromaticInterval` classes, created automatically by the `Interval` object, and stored as `.diatonic` and `.chromatic` attributes: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.DiatonicInterval P5>"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p5 = interval.Interval('P5')\n",
    "p5.diatonic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.ChromaticInterval 7>"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p5.chromatic"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `DiatonicInterval` class handles all the under-the-hood tasks of figuring out that, say \"AA6\" should have a `.niceName` of \"Doubly-Augmented Sixth\", or that the complement of a major interval is a minor interval, etc.\n",
    "\n",
    "The `ChromaticInterval` class keeps track of things such as the `.intervalClass`, the `.mod12` number of semitones, etc.\n",
    "\n",
    "Unless you're doing something very complicated, you won't need to use them directly, but they're sometimes useful when you need to work around those weird corner cases, such as a doubly-diminished second, which is ascending diatonically (that is to say, a note a doubly-diminished second \"above\" another note will be written above it, such as E# to F-flat), but is descending chromatically (that is, the piano key for E# is higher than the one for F-flat)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.Interval dd2>"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd2 = interval.Interval('dd2')\n",
    "dd2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd2.semitones"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Direction.ASCENDING: 1>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd2.diatonic.direction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Direction.DESCENDING: -1>"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd2.chromatic.direction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The related interval class that might come in handy the most is the GenericInterval class.  This class represents intervals such as \"Thirds\" and \"Fifths\" without regards to specifiers such as \"Major,\" \"minor,\" \"diminished,\" \"Perfect,\" etc."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.interval.GenericInterval 3>"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gi = interval.GenericInterval('third')\n",
    "gi"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or just as easy (if one keeps track of the difference between Generic and Chromatic Intervals):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "gi = interval.GenericInterval(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This interval can be used to transpose elements modally:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.note.Note A#>"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gi.transposeNote(note.Note('F#'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Generic Intervals can also be used to do key-aware modal transpositions on Streams."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABdgAAABiCAYAAABDJrG8AAAACXBIWXMAAB7CAAAewgFu0HU+AAAg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G3AmMFzyeA75I7YTXjMx7mFzvnl2A2yn+vxsH/gAchC2C1f+eD1wP/A14WY9jGQYHA2cBa/Q6EEmSJJViAc2VfJUkSTW0mzx9L3BmMv8M8E1gNeCvwI+JpFctXweOJFpK7gD8sc141LhJRGmePYANiRsiDwK3ApcAd/QuNEmSJElSSRYA6wNr9joQSZIEE4mWzmmr5/NpvETDxzOvO7GU6CRJkiRJUta1WPpPkqS+sjHwAJVk+a+AOTW2nwF8JbP9z7AMiSRJkiRJ3fBiYLdeByFJkla0LTGQaZo0X0yUi3kjsCOwHfBa4Azg/sx2PwGmdD9cSZIkSZIkSZL6x3rAT6k9cGY2AX8iUWJGkiRJkiRJkiQBOwP/QdR0q06s3wycTJSVkSRJkiRJkiRpYP1/1RM3vbncsB8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 748
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = converter.parse(\"tinyNotation: 4/4 d4 e f f# g1 a-4 g b- a c'1\")\n",
    "s.measure(1).insert(0, key.Key('G'))\n",
    "s.measure(3).insert(0, key.Key('c'))\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABdgAAABiCAYAAABDJrG8AAAACXBIWXMAAB7CAAAewgFu0HU+AAAgAElEQVR4nO3debwddXn48U9ICCQQIASI7GENm6wugCAI1JWyShEEFUtFRepS91dVfiCuCFoVLYiiICKCIq0FF8CfIghWEGUTIgTKvgdISMgl6R/PTM/cc2fOPmf9vF+v8zpzZubMPHfuvbM8853nC923D/AosBDYpgfrlyRJkiRJkiRp4LwVWAosT163ANN6GpEkSZIkSZIkSX3uTcALVJLr6eszvQwqx2Tgy8C7eh2IJEmSJEmSJEkvBZYwMbm+PBm/Ve9Cm2ATIq57eh2IJEmSJEmSJGm0rQ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Ak9Y17gZt6HYQkaTBtBDxMJVl+FbBejflXBb6emf+nwKSSY5QkSZKkTpkD7N/rICT1ld2BnXsdhCRpcG1PdGSaJs0XEuViDgVeAuwAvAE4HXgoM9/FwNTuhytJkiRJkiRJUv+YDfyY4k5Ps6+FRFmYyT2JVJIkSZIkSZKkPrQr8C3gASYm1m8DTiLKykiSJEmSJEmSNLD+F0TPwzdwkXVUAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 748
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "upASecond = interval.GenericInterval('second')\n",
    "s2 = s.transpose(upASecond)\n",
    "s2.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that the chromatic alterations from the previous scale step carry over after the transposition, so that, for instance, the new version of the first measure ends up having the enharmonically equivalent F# and G-flat directly following each other.  In this case, probably what would be wanted is to run a getEnharmonic call on the notes afterwards.  In the second key, however, the pattern of notes ends up preserving the exact chromatic distances, almost creating the BACH motive (BAsCH?)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "sphinx_links": {
     "any": true
    }
   },
   "source": [
    "Enough about intervals for now; we'll come back to them when we analyze pieces more deeply. For now, let's get back to rhythms, and look at some of the more complex rhythmic devices we haven't considered yet, in :ref:`Chapter 19, Advanced Durations <usersGuide_19_duration2>`"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
